<template>
  <div id="app">
    <workPlatformOrg v-if="isOrgShow" ref="workPlatformOrg" @callback="closeAdd" ></workPlatformOrg>
    <workPlatform v-else ref="workPlatform" @callback="closeAdd"></workPlatform>
  </div>
</template>
<script>
import workPlatformOrg from "./work_platform_org";
import workPlatform from "./workPlatform";
var vm;
let user;
export default {
  data() {
    return {
      isOrgShow: null
    };
  },
  components: {
    workPlatformOrg,
    workPlatform
  },
  methods: {
    closeAdd() {},
    campusChange : function(campusId) { //校区改变
      if(!vm.isOrgShow){
       vm.$refs.workPlatform.campusChange(campusId);
      }
    },
  },
  created() {
    vm = this;
    // user = tool.getItem(lsKey.user, true); //得到当前用户信息
    if (vm.$store.state.roleMode <= 1) {
      vm.isOrgShow = true;
      this.$nextTick(() => {
        vm.$refs.workPlatformOrg.init();
      });
    } else {
      vm.isOrgShow = false;
      this.$nextTick(() => {
        vm.$refs.workPlatform.init();
      });
    }
  }
};
</script>